//
//  SJAuthStep2View.m
//  SJPay
//
//  Created by 凯朱 on 2024/11/28.
//

#import "SJAuthStep2View.h"

@implementation SJAuthStep2View
-(void)awakeFromNib{
    [super awakeFromNib];
    
    
    _tf1.placeholder = _tf2.placeholder = kLocalString(@"请选择");
    _tf1.userInteractionEnabled = _tf2.userInteractionEnabled  = NO;
    _tf5.placeholder = kLocalString(@"请输入您的公司名称");
    _tf6.placeholder = kLocalString(@"请输入您的公司地址");
    _tf7.placeholder = kLocalString(@"请输入您的公司电话");
    _tf8.placeholder = kLocalString(@"请选择证件类型并上传清晰完整的证件照");
    
    [self addTapWith:1 btn:_btn1];
    [self addTapWith:2 btn:_btn2];
    [self addTapWith:4 btn:_photoBtn];
    
    _photoBtn.layer.cornerRadius = 5;
    _photoBtn.layer.masksToBounds = YES;
    
    _titleLbl.text = kLocalString(@"工作信息");
    _tipLbl1.text = kLocalString(@"职业：");
    _tipLbl2.text = kLocalString(@"每月收入：");
    _tipLbl5.text = kLocalString(@"公司名称：");
    _tipLbl6.text = kLocalString(@"公司地址：");
    _tipLbl7.text = kLocalString(@"公司电话：");
    _tipLbl8.text = kLocalString(@"上传证件照：");
    
    [_nextBtn setTitle:kLocalString(@"下一步") forState:UIControlStateNormal];
    
    _bgView1.layer.cornerRadius = 5;
    _bgView1.layer.masksToBounds = YES;
    _bgView1.layer.borderWidth = 1.5;
    _bgView1.layer.borderColor = kHexColor(@"#C0C9EC").CGColor;
    
    _nextBtn.layer.cornerRadius = 25;
    _nextBtn.layer.masksToBounds = YES;
    
    _bgView2.layer.cornerRadius = 5;
    _bgView2.layer.masksToBounds = YES;
    
  
}

- (IBAction)btnAction:(id)sender {
    if (sender == _locationBtn) {
        if (self.btnBlock) self.btnBlock(3);
    }else if (sender == _nextBtn){
        if (self.btnBlock) self.btnBlock(5);
    }
}

-(void)addTapWith:(NSInteger)index btn:(UIView *)btn{
    kWeakSelf(self);
    btn.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
        if (weakself.btnBlock) {
            weakself.btnBlock(index);
        }
    }];
    [btn addGestureRecognizer:tap];
}

@end
